import { Injectable } from '@angular/core';
import { Menus } from './menu';
import { AuthService } from '../auth/auth.service';

@Injectable({ providedIn: 'root' })
export class MenuService {

    constructor(private authService: AuthService) {}

    initMenuListByRole() {
        const currentRole = this.authService.currentUser.roleCode;
        return JSON.parse(JSON.stringify(Menus[currentRole]));
    }
}
